#ifndef REFINEMENTALGORITHM_H_
#define REFINEMENTALGORITHM_H_

#include "../selectioncriterions/selectioncriterion.h"
#include "../../geom/mesh.h"
#include "../../geom/triangle.h"
#include <QtCore/QMap>
#include <QtCore/QThread>

class RefinementAlgorithm : public QThread
{
	Q_OBJECT
protected:
	Mesh *mesh;
	QMap<Triangle *,bool> work_set;
	int done, total;
	void run();
	virtual void processMesh()=0;
	virtual void removeFromPending(Triangle *t);
public:
	RefinementAlgorithm(Mesh *m,SelectionCriterion *c);
	virtual ~RefinementAlgorithm();
	int getTotal(){
		return total;
	}
	virtual int getDone(){
		return done;
	}
};

#endif /*REFINEMENTALGORITHM_H_*/
